/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.rs.manager.impl;

import java.util.Collection;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xy.biz.rs.domain.bo.TechniqueBO;
import com.xy.biz.rs.domain.query.TechniqueQuery;
import com.xy.biz.rs.domain.converter.TechniqueConverter;
import com.xy.biz.rs.manager.TechniqueManager;
import com.xy.biz.rs.dao.TechniqueDao;

/**
 *
 *
 * @author wwj
 * @date 2021-4-13
 */
@Service
public class TechniqueManagerImpl implements TechniqueManager {

	@Autowired
	private TechniqueDao techniqueDao;

	@Override
	public int saveTechnique(TechniqueBO techniqueBO) {
		return techniqueDao.saveTechnique(TechniqueConverter.toPO(techniqueBO));
	}

	@Override
	public int saveAllTechnique(Collection<TechniqueBO> collection) {
		return techniqueDao.saveAllTechnique(TechniqueConverter.toPO(collection));
	}

	@Override
	public int updateTechnique(TechniqueBO techniqueBO) {
		return techniqueDao.updateTechnique(TechniqueConverter.toPO(techniqueBO));
	}

	@Override
	public int deleteTechnique(Long techniqueId) {
		return techniqueDao.deleteTechnique(techniqueId);
	}

	@Override
	public TechniqueBO getTechnique(Long techniqueId) {
		return TechniqueConverter.fromPO(techniqueDao.getTechnique(techniqueId));
	}

	@Override
	public List<TechniqueBO> listTechniqueById(Collection<Long> collection) {
		return TechniqueConverter.fromPO(techniqueDao.listTechniqueById(collection));
	}

	@Override
	public List<TechniqueBO> listTechnique(TechniqueQuery query) {
		return TechniqueConverter.fromPO(techniqueDao.listTechnique(query));
	}

	@Override
	public int countTechnique(TechniqueQuery query) {
		return techniqueDao.countTechnique(query);
	}

}
